/**
 * 
 */
package com.dalonedrau.jogl.engine;

/**
 * Error handler class.
 * @author DaLoneDrau
 */
public final class JOGLErrorHandler {
	/** the singleton instance of <code>ErrorHandler</code>. */
	private static JOGLErrorHandler	instance;

	/**
	 * Gets the singleton instance of <code>ErrorHandler</code>.
	 * @return {@link JOGLErrorHandler}
	 */
	public static JOGLErrorHandler getInstance() {
		if (JOGLErrorHandler.instance == null) {
			JOGLErrorHandler.instance = new JOGLErrorHandler();
		}
		return JOGLErrorHandler.instance;
	}
	/** flag indicating whether the game is run through an applet. */
	private boolean	isApplet	= true;
	/** Hidden constructor. */
	private JOGLErrorHandler() { }
	/**
	 * Processes a fatal error and stops the game.
	 * @param ex the error
	 */
	public void fatalError(final Exception ex) {
		if (isApplet) {
			GameApplet.getInstance().fatalError(ex);
		}
	}
}
